<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Date
 *
 * @author Sebastian
 */
class Common_System_Date
{
     const DAY_SECONDS = 86400;

     /**
      *
      * @param string $date: debe estar en formato ISO-8601
      * @return long
      */
     public static function getTimestamp($date)
     {
         $date = explode("-",$date);
         return mktime(0,0,0,$date[1],$date[2],$date[0]);
     }

     public static function isBetween($in, $out, $day)
     {
         $in = self::getTimestamp($in);
         $out = self::getTimestamp($out);
         $day = self::getTimestamp($day);

         if( $in <= $day && $out > $day )
            return true;

         return false;
     }
}
?>
